blob: ff764add060e6b95e78546283989b47ad27c95c8 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
|
<script lang="ts">
import Hayai from "./../../../lib/Tools/Hayai.svelte";
import UmaMusumeBirthdays from "./../../../lib/Tools/UmaMusumeBirthdays.svelte";
import ActivityHistory from "$lib/Tools/ActivityHistory/Tool.svelte";
import Wrapped from "$lib/Tools/Wrapped/Tool.svelte";
import EpisodeDiscussionCollector from "$lib/Tools/EpisodeDiscussionCollector.svelte";
import CharacterBirthdays from "$lib/Tools/Birthdays.svelte";
import SequelSpy from "$lib/Tools/SequelSpy/Tool.svelte";
import { closest } from "$lib/Error/path";
import HeadTitle from "$lib/Home/HeadTitle.svelte";
import RandomFollower from "$lib/Tools/RandomFollower.svelte";
// import DumpProfile from '$lib/Tools/DumpProfile.svelte';
import { tools } from "$lib/Tools/tools.js";
import { onMount } from "svelte";
import { goto } from "$app/navigation";
import Picker from "$lib/Tools/Picker.svelte";
import Likes from "$lib/Tools/Likes.svelte";
import root from "$lib/Utility/root.js";
import Popup from "$lib/Layout/Popup.svelte";
import SequelCatcher from "$lib/Tools/SequelCatcher/Tool.svelte";
import Tracker from "$lib/Tools/Tracker/Tool.svelte";
import BirthdaysTemplate from "$lib/Tools/BirthdaysTemplate.svelte";
import type { PageData } from "./$types";
export let data: PageData;
let tool = data.tool ?? "default";
onMount(() => {
if (tool === "default") goto(root("/tools"));
});
$: suggestion = closest(tool, Object.keys(tools));
$: if (tool === "girls") goto(root("/girls"));
</script>
<Picker bind:tool />
{#if !Object.keys(tools).includes(tool)}
<HeadTitle route="Tools" path="/tools" />
<Popup>
<p style="text-align: center;">
Tool "<a href={root(`/tools/${tool}`)}>{tool}</a>" not found
</p>
<blockquote style="margin: 0 0 0 1.5rem;">
Did you mean "<a
href={root(`/tools/${tools[suggestion].id}`)}
onclick={() => (tool = suggestion)}
style={suggestion === '...' ? 'pointer-events: none; color: inherit;' : ''}
>
{suggestion === '...' ? '...' : tools[suggestion].name()}</a
>"?
</blockquote>
</Popup>
{:else}
<HeadTitle route={tools[tool].name()} path={`/tools?tool=${tool}`} />
{#if tool === 'activity_history'}
<ActivityHistory user={data.user} />
{:else if tool === 'wrapped'}
<Wrapped user={data.user} />
{:else if tool === 'discussions'}
<EpisodeDiscussionCollector />
{:else if tool === 'birthdays'}
<CharacterBirthdays />
{:else if tool === 'sequel_spy'}
<SequelSpy user={data.user} />
{:else if tool === 'random_follower'}
<RandomFollower />
<!-- {:else if tool === 'dump_profile'}
<DumpProfile /> -->
{:else if tool === 'likes'}
<Likes />
{:else if tool === 'uma_musume_birthdays'}
<UmaMusumeBirthdays />
{:else if tool === 'hayai'}
<Hayai />
{:else if tool === 'hololive_birthdays'}
<BirthdaysTemplate
remoteURL="https://raw.githubusercontent.com/Fuwn/hololist-to-json-and-ical/refs/heads/main/data/latest_hololive.json"
/>
{:else if tool === 'nijisanji_birthdays'}
<BirthdaysTemplate
remoteURL="https://raw.githubusercontent.com/Fuwn/hololist-to-json-and-ical/refs/heads/main/data/latest_nijisanji.json"
/>
{:else if tool === 'sequel_catcher'}
<SequelCatcher user={data.user} />
{:else if tool === 'tracker'}
<Tracker />
{/if}
{/if}
|